﻿@using Smartstore.Web.Models.Topics;

@model TopicModel

@if (Model.Body == null || !Model.Body.Value.HasValue())
{
    return;
}

@if (ViewBag.BodyOnly)
{
    <div class="topic-html-content-body@(ViewBag.IsLead == true ? " lead" : "") my-3 html-editor-content" id="ph-topic-body-@Model.Id" sm-language-attributes-for="Model.Body">
        <collapsed-content>
            @Html.Raw(Model.Body)
        </collapsed-content>
    </div>
}
else
{
    <div id="ph-topic-@Model.Id" class="block topic-html-content my-3">
        <div sm-if="Model.Title.HasValue()" class="block-title" id="ph-title-@Model.Id">
			@if (ViewBag.IsLead == true)
			{
				<h1 class="h2" sm-language-attributes-for="Model.Title">@Model.Title</h1>
			}
			else
			{
				<h4 sm-language-attributes-for="Model.Title">@Model.Title</h4>
			}
        </div>
        <div class="block-body html-editor-content topic-html-content-body@(ViewBag.IsLead == true ? " lead" : "")" sm-language-attributes-for="Model.Body">
			<p sm-if="Model.Intro.HasValue() && (ViewBag.IsLead == null || ViewBag.IsLead == false)" class="topic-intro lead">
				@Html.Raw(Model.Intro)
			</p>
            <collapsed-content>
                @Html.Raw(Model.Body)
            </collapsed-content>
        </div>
    </div>
}
